home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / gnu / bash / bash_110 / mint / bash110s.zoo / bash-1.10 / support / cppmagic < prev    next >
Encoding:
Text File  |  1991-07-28  |  430 b   |  27 lines

  1. #!/bin/sh
  2. # Make a list of flags to pass to /lib/cpp.
  3. #
  4.  
  5. if [ "$2" ]; then
  6.   Cpp=$2
  7. else
  8.   Cpp=/lib/cpp
  9. fi
  10.  
  11. TRADITIONAL=
  12. FLAGS=
  13.  
  14. # First flag might be `-traditional' if this is Gnu Cpp.
  15. if [ -f $Cpp ]; then
  16.    unknown_flag=`$Cpp -traditional /dev/null 2>&1 |
  17.           egrep 'known|recognized|valid|bad'`
  18.   if [ ! "$unknown_flag" ]; then
  19.     TRADITIONAL=-traditional
  20.   fi
  21. fi
  22.  
  23. if [ "$1" ]; then
  24.    FLAGS=`$1`
  25. fi
  26. echo $TRADITIONAL $FLAGS
  27.